<template>
  <view class="mine-container" :style="{height: `${windowHeight}px`}">
    <!--顶部个人信息栏-->
    <view class="header-section">
      <view class="flex padding justify-between">
        
      </view>
    </view>

    <view class="content-section">
      <view class="mine-actions grid col-3 text-center">
        <view class="action-item" @click="handleJiaoLiuQun">
          <view class="iconfont icon-friendfill text-pink icon"></view>
          <text class="text">证书查询</text>
        </view>
        <view class="action-item" @click="handleToChanggui">
          <view class="iconfont icon-service text-blue icon"></view>
          <text class="text">常规鉴定</text>
        </view>
        <view class="action-item" @click="handleBuilding">
          <view class="iconfont icon-community text-mauve icon"></view>
          <text class="text">灾后重建</text>
        </view>
        <view class="action-item" @click="handleBuilding">
          <view class="iconfont icon-dianzan text-red icon"></view>
          <text class="text">隐患排查</text>
        </view>
		<view class="action-item" @click="handleBuilding">
		  <view class="iconfont icon-code text-yellow icon"></view>
		  <text class="text">危房鉴定</text>
		</view>
		<view class="action-item" @click="handleBuilding">
		  <view class="iconfont icon-setting text-purple icon"></view>
		  <text class="text">鉴定预约</text>
		</view>
		<view class="action-item" @click="handleBuilding">
		  <view class="iconfont icon-logout text-brown icon"></view>
		  <text class="text">报告查询</text>
		</view>
      </view>

    </view>
  </view>
</template>

<script>
  import storage from '@/utils/storage'

  export default {
    data() {
      return {
        name: this.$store.state.user.name,
        version: getApp().globalData.config.appInfo.version
      }
    },
    computed: {
      avatar() {
        return this.$store.state.user.avatar
      },
      windowHeight() {
        return uni.getSystemInfoSync().windowHeight - 50
      }
    },
    methods: {
      handleToChanggui() {
        this.$tab.navigateTo('/pages/busin/changgui/identifyForm')
      },
      handleToEditInfo() {
        this.$tab.navigateTo('/pages/mine/info/edit')
      },
      handleToSetting() {
        this.$tab.navigateTo('/pages/mine/setting/index')
      },
      handleToLogin() {
        this.$tab.reLaunch('/pages/login')
      },
      handleToAvatar() {
        this.$tab.navigateTo('/pages/mine/avatar/index')
      },
      handleLogout() {
        this.$modal.confirm('确定注销并退出系统吗？').then(() => {
          this.$store.dispatch('LogOut').then(() => {
            this.$tab.reLaunch('/pages/index')
          })
        })
      },
      handleHelp() {
        this.$tab.navigateTo('/pages/mine/help/index')
      },
      handleAbout() {
        this.$tab.navigateTo('/pages/mine/about/index')
      },
      handleJiaoLiuQun() {
        this.$modal.showToast('微信搜索 naidaguo 后，添加好友后拉你进技术交流群')
      },
      handleBuilding() {
        this.$modal.showToast('模块建设中~')
      }
    }
  }
</script>

<style lang="scss">
  page {
    background-color: #f5f6f7;

  }

  .mine-container {
    width: 100%;
    height: 100%;
    background-image: url('/static/images/login_1.png');

    .header-section {
      padding: 15px 15px 155px 15px;
      background-color: #3c96f3;
	  
      color: white;

      .login-tip {
        font-size: 18px;
        margin-left: 10px;
      }

      .cu-avatar {
        border: 2px solid #eaeaea;

        .icon {
          font-size: 40px;
        }
      }

      .user-info {
        margin-left: 15px;

        .u_title {
          font-size: 18px;
          line-height: 30px;
        }
      }
    }

    .content-section {
      position: relative;
      top: -80px;

      .mine-actions {
        margin: 15px 15px;
        padding: 20px 0px;
        border-radius: 8px;
        background-color: white;

        .action-item {
			margin: 25rpx 0  25rpx 0;
          .icon {
            font-size: 28px;
          }

          .text {
            display: block;
            font-size: 13px;
            margin: 8px 0px;
          }
        }
      }
    }
  }
</style>